]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't crash displaying contacts with no alias
authorAlexander Larsson <alexl@redhat.com>
Tue, 30 Aug 2011 09:13:35 +0000 (11:13 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 30 Aug 2011 09:13:35 +0000 (11:13 +0200)
If a folks individual has no alias we crash when passing in NULL
to strstr(). Fix this by checking for non-null first.

src/shell-contact-system.c

index 971a164990ed87928d193bb4920724478887c448..9ac79de61f7db502b371efca5603ae0450c249d2 100644 (file)
@@ -134,11 +134,14 @@ do_match (ShellContactSystem  *self,
       const char *p;
 
       /* Match on alias */
-      p = strstr (alias, term);
-      if (p == alias)
-        have_alias_prefix = TRUE;
-      else if (p != NULL)
-        have_alias_substring = TRUE;
+      if (alias != NULL)
+       {
+         p = strstr (alias, term);
+         if (p == alias)
+           have_alias_prefix = TRUE;
+         else if (p != NULL)
+           have_alias_substring = TRUE;
+       }
 
       /* Match on one or more IM addresses */
       im_addrs_iter = gee_iterable_iterator (GEE_ITERABLE (im_addrs));